<template>
  <el-drawer :title="title" :visible.sync="drawer" :direction="direction" :before-close="handleClose">
    <div class="content">
      <div class="item" v-for="{ key, value } in columns" :key="key">
          <span style="color:#999999;text-align: left;">{{ key }}:</span>
          <span style="text-align: right;">{{ data[value] }}</span>
      </div>
    </div>
  </el-drawer>
</template>
  
<script>
export default {
  components: {},
  props: ["title", "data", 'columns'],
  data() {
    return {
      drawer: false,
      direction: "rtl",
    };
  },
  methods: {
    open() {
      this.drawer = true;
    },
    handleClose() {
      this.drawer = false;
    },
  },
  created() { },
};
</script>
<style lang="scss" scoped>
.content {
  display: flex;
  flex-direction: column;
  padding: 20px;

  .item {
    padding: 10px 0px;
    display: flex;
    font-size: 14px;

    span:nth-child(1) {
      width: 125px;
      text-align: right;
    }

    span:nth-child(2) {
      flex: 1;
      margin-left: 20px;
    }
  }
}
::v-deep .el-drawer__header {
  padding: 20px 0px 10px;
  border-bottom: 1px solid #DDDDDD;
  margin: 0 20px;
  font-size: 16px;
  font-weight: 600;
  color: #333333;
  line-height: 24px;
}
::v-deep .el-drawer__header {
  margin-bottom: 0;
}
</style>
  